import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Home from '../pages/Home.vue'
// 引入组件
// import Login from '../pages/Login.vue'
import Register from '../pages/register.vue'
import ProFile from '../pages/profile.vue'
import EditProfile from '../pages/EditProfile.vue'
import MyFollow from '../pages/MyFollow.vue'
import Test from '../pages/Test.vue'
import MyComments from '@/pages/MyComments'
import MyCollections from '@/pages/MyCollections'
import PostDetail from '../pages/postDetail.vue'
import Search from '../pages/Search.vue'
import MoreComments from '../pages/MoreComments.vue'
import TabManager from '../pages/TabManager.vue';
// 注册路由
Vue.use(Router)
// 创建路由实列
export default new Router({
  // 配置路由数据
  routes: [
    {
      path: '/',
      name: 'homePage',
      component: Home
    },
    {
      path: '/login',
    name: 'logPage',
    // 路由的懒加载
    component: ()=>import("../pages/Login.vue")
    
    },
    {
      path: '/register',
      name: 'registerPage',
      component: Register
    },
    {
      path: '/profile',
      name: 'profilepage',
      component: ProFile
    },
    {
      path: '/editprofile',
      name: 'editProfilePage',
      component: EditProfile
    },
    {
      path: '/myfollow',
      name: 'myfollowPage',
      component: MyFollow
    },
    {
      path: '/test',
      name: 'testPage',
      component: Test
    },
    {
      path: '/mycomments',
      name: 'mycommentsPage',
      component: MyComments
    },
    {
      path: '/mycollections',
      name: 'mycollectionsPage',
      component: MyCollections
    },
    {
      path: '/postdetail/:id',
      name: 'postdetailPage',
      component: PostDetail
    },
    {
      path: '/search',
      name: 'searchPage',
      component: Search
    },
    {
      path: '/morecomments/:id',
      name: 'morecommentsPage',
      component: MoreComments
    },
    {
      path: '/tabmanager',
      name: 'tabmanagerPage',
      component: TabManager
    }
  ]
})
